# -*- coding: utf-8 -*-
from zinx.ziface.iconnection import IConnection
from abc import ABC, abstractmethod

class IConManager(ABC):
    """
    连接管理抽象层
    """
    @abstractmethod
    def Add(self, Conn: IConnection):
        """
        添加链接
        :param Conn:
        :return:
        """
        pass

    @abstractmethod
    def Remove(self, Conn: IConnection):
        """
        删除连接
        :param Conn:
        :return:
        """
        pass

    @abstractmethod
    def Get(self, connID: int) -> IConnection:
        """
        利用ConnID获取链接
        :param connID:
        :param Conn:
        :return:
        """
        pass

    @abstractmethod
    def Len(self) -> int:
        """
        获取当前连接个数
        :return:
        """
        pass

    @abstractmethod
    def ClearConn(self):
        """
        删除并停止所有链接
        :return:
        """
